package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.domain.DestinationTemplate;
import cn.wolfcode.luowowo.search.repository.DestinationTemplateRepository;
import cn.wolfcode.luowowo.search.service.IDestinationTemplateSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class DestinationTemplateSearchServiceImpl implements IDestinationTemplateSearchService {

    //es 依然使用spring-data-jpa

    //repository 封装了template
    //template 封装了 client

    @Autowired
    private DestinationTemplateRepository repository;
//    @Autowired
//    private ElasticsearchTemplate template;
//    @Autowired
//    private TransportClient client;  //java操作es的第三方客户端
//
//
    @Override
    public void saveOrUpdate(DestinationTemplate template) {
        repository.save(template);
    }

    @Override
    public DestinationTemplate findByName(String name) {

        return repository.findByName(name);
    }
//
//    @Override
//    public DestinationTemplate findByName(String keyword) {
//        return repository.findByName(keyword);
//    }
}
